import { IPSDEGridColumn } from './ipsdegrid-column';
import { IPSDEGridGroupColumn } from './ipsdegrid-group-column';
import { PSDEGridColumnImpl } from './psdegrid-column-impl';

export class PSDEGridGroupColumnImpl extends PSDEGridColumnImpl implements IPSDEGridGroupColumn {
  protected psdegridcolumns: IPSDEGridColumn[] | null = null;

  getPSDEGridColumns(): IPSDEGridColumn[] | null {
    if (this.psdegridcolumns == null) {
      this.psdegridcolumns = this.fillChildListModel(this.M.getPSDEGridColumns, 'control.grid.IPSDEGridColumn') as IPSDEGridColumn[];
    }
    return this.psdegridcolumns;
  }

  get psDEGridColumns(): IPSDEGridColumn[] | null {
    return this.getPSDEGridColumns();
  }

  findPSDEGridColumn(objKey: any): IPSDEGridColumn | null {
    return this.getPSModel5('control.grid.IPSDEGridColumn', this.getPSDEGridColumns(), objKey) as IPSDEGridColumn;
  }

  get cls(): string {
    return 'PSDEGridGroupColumnImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.grid.IPSDEGridGroupColumn') return true;
    return super.instanceof(cls);
  }
}
